package agents.election;

import agents.TrafficLightAgent;

public class GroupBallot {

	private static final Object lock = new Object();
	private static int seq = 0;
	
	private final TrafficLightAgent agent;
	private final long rand;
	private final int hash;
	
	public GroupBallot(TrafficLightAgent agent, long rand) {
		this.agent = agent;
		this.rand = rand;
		
		synchronized(lock) {
			this.hash = GroupBallot.seq++;
		}
	}

	public final TrafficLightAgent getAgent() {
		return agent;
	}

	public final long getRand() {
		return rand;
	}
	
	@Override
	public int hashCode() {
		return hash;
	}
	
}
